Access to values and other resources in distributed systems may be controlled through use of resource locks, which restrict the ability of multiple processes to simultaneously access or modify a value at a particular time. For example, multiple simultaneous attempts to change or update a value stored in a database may result in one or more processes acting on a version of the value that has been previously changed or replaced. Pessimistic resource locks ensure that only one process may access a stored value at any given time, but may result in resource starvation as other processes are unable to access the stored value, especially in situations where the process acts slowly or fails without relinquishing the lock. Optimistic resource locks permit multiple processes to access and attempt to modify a stored value, while performing checks to ensure that each received modification is applied to the latest available version of the value. While suitable for use with a small number of processes, use of optimistic locks with large-scale systems is infeasible due to the number of processes attempting to use the same stored value. A system that allows for controlled access to values in a high throughput system is thus desired.
While implementations are described herein by way of example, those skilled in the art will recognize that the implementations are not limited to the examples or figures described. It should be understood that the figures and detailed description thereto are not intended to limit implementations to the particular form disclosed but, on the contrary, the intention is to cover all modifications, equivalents, and alternatives falling within the spirit and scope as defined by the appended claims. The headings used herein are for organizational purposes only and are not meant to be used to limit the scope of the description or the claims. As used throughout this application, the word “may” is used in a permissive sense (i.e., meaning having the potential to), rather than the mandatory sense (i.e., meaning must). Similarly, the words “include,” “including,” and “includes” mean including, but not limited to.